package com.ruoyi.market.enums;

import cn.hutool.core.util.StrUtil;
import lombok.Getter;

@Getter
public enum StatusEnum {

    ENABLE("1", "可用"),
    UNENABLE("0", "不可用"),
    ;

    String value;
    String name;

    StatusEnum(String value, String name){
        this.value = value;
        this.name = name;
    }

    public static String getNameByValue(String value){
        for (StatusEnum item : values()) {
            if (StrUtil.equals(item.getValue(), value)){
                return item.getName();
            }
        }
        return value;
    }
}
